import http from '@/utils/request.js'

export const loginAPI = (params) => http.post("/login", params);
export const logoutAPI = () => http.post("/logout")

export const getMenusAPI = () => http.get("/getRouters");

export const getInfoAPI = () => http.get("/getInfo");

export const getUserLIstAPI = (params) => http.post("/user/userList", params);

export const changeUserStatusAPI = (params) => http.put("/user/changeUserStatus/", params);
export const UploadImgAPI = (data) => http.post("/upload", data, {
    headers: {
        'Content-Type': 'multipart/form-data'
    }
})
export const addUserAPI = (params) => http.post("/user/addUser", params)
export const getRoleIdByUserIdAPI = (id) => http.get(`/userRole/getRoleIdByUserId/${id}`)
export const updateUserAPI = (params) => http.put("/user/updateUser", params)

export const getAllRolesAPI = () => http.get("/role/getAllRoles");

export const getRoleListAPI = (params) => http.post("/role/roleList", params);

export const changeRoleStatusAPI = (params) => http.put("/role/changeRoleStatus", params);

export const addRoleAPI = (params) => http.post("/role/addRole", params);

export const updateRoleAPI = (params) => http.put("/role/updateRole", params);

export const getMenuTreeAPI = () => http.get("/menu/menuTree");

export const getRoleMenuAPI = (id) => http.get(`/roleMenu/getMenusByRoleId/${id}`);

export const updateRoleMenuAPI = (id, menusId) => http.post(`/roleMenu/updateRoleMenu/${id}`, menusId)

export const getMenuListAPI = (params) => http.post("/menu/getMenuList", params)

export const treeListAPI = () => http.get("/menu/treeList");

export const addMenuAPI = (params) => http.post("/menu/addMenu", params)
export const updateMenuAPI = (params) => http.put("/menu/updateMenu", params);

export const addCityAPI = (params) => http.post("/city/addCity", params);
export const getAllCityAPI = () => http.get("/city/selectAllCity");
export const cityListAPI = (params) => http.post("/city/cityList", params);
export const updateCityAPI = (params) => http.put("/city/updateCity", params)

export const addSpotAPI = (params) => http.post("/spot/addSpot", params);
export const spotListAPI = (params) => http.post("/spot/spotList", params)
export const updateSpotAPI = (params) => http.put("/spot/updateSpot", params);

export const categoryListAPI = (params) => http.post("/category/categoryList", params)
export const addCategoryAPI = (params) => http.post("/category/addCategory", params);
export const updateCategoryAPI = (params) => http.put("/category/updateCategory", params);
export const categoriesAPI = () => http.get("/category/categories");

export const getArticleListAPI = (params) => http.post("/article/getArticleList", params);
export const addArticleAPI = (params) => http.post("/article/addArticle", params);
export const updateArticleAPI = (params) => http.put("/article/updateArticle", params);

export const addGalleryAPI = (params) => http.post("/gallery/addGallery", params);
export const galleryListAPI = (params) => http.post("/gallery/galleryList", params);
export const updateGalleryAPI = (params) => http.put("/gallery/updateGallery", params);

export const messageListAPI = (params) => http.post("/message/messageList", params);
export const addMessageAPI = (params) => http.post("/message/addMessage", params);
export const updateMessageAPI = (params) => http.put("/message/updateMessage", params);